import React, {Component} from 'react'
import {Link} from 'react-router'
import '../sass/SearchBar'


export default class SearchBar extends Component {
  constructor() {
    super()
  }

  render() {
    const {getSearchList, showHistory, cancelSearch} = this.props

    return (
      <section className="search-box">
        <form id="searchForm" onSubmit={getSearchList.bind(this)} action="javascript:return true">
            <i className="iconfont icon-sousuo1"></i>
          <input
            id="search"
            type="search"
            placeholder="请输入要搜索的商品名称"
            onFocus={showHistory.bind(this, true)}
          />
          <Link onClick={cancelSearch.bind(this)} className="ser-link">取消</Link>
        </form>
      </section>
    )
  }
}
